package net.caixiaomi.info.util;


import android.text.TextUtils;
import android.widget.Toast;

import net.caixiaomi.info.app.CommonApp;

public class ToastUtil {

    private static long mBeforeTimes=0;
    private static String mBeforeText="";
    private static int mBeforeId;

    public static void s(String text) {
        long curentTime=System.currentTimeMillis();
        if(curentTime-mBeforeTimes<2000&& TextUtils.equals(mBeforeText,text)){
            return;
        }
        mBeforeTimes=curentTime;
        mBeforeText=text;
        Toast.makeText(CommonApp.getInstance(), text, Toast.LENGTH_LONG).show();
    }
    public static void s(int id) {
        long curentTime=System.currentTimeMillis();
        if(curentTime-mBeforeTimes<2000&& mBeforeId==id){
            return;
        }
        mBeforeTimes=curentTime;
        mBeforeId=id;
        Toast.makeText(CommonApp.getInstance(), id, Toast.LENGTH_LONG).show();
    }
}
